<me:UIVAART x:Class="WPFExcelReport.TEXARTLIST"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
                     xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"  
                    xmlns:DR="clr-namespace:WPFExcelReport;assembly=TDRAUFTR"  
                     x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIVAART.Resources> 
        <CollectionViewSource  x:Key="vwMaster"/>
        <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:NOTBoolToVisibilityConverter  x:Key="nbv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:NOTConverter  x:Key="not"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:TRIMGB2312Convert8859P1 x:Key="tgb"/>
        <ucd:TextTrimmingConverter x:Key ="trim"/>

    </me:UIVAART.Resources>
    <Grid Grid.Row="1" Grid.Column="1" >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="1*"/>
        </Grid.RowDefinitions>
        <StackPanel>
            <WrapPanel Margin="20,0,0,0">
                <DR:TDRAUFTR  Grid.Column="0" Name="cDR" Visibility="Collapsed"
                                           VerticalAlignment="Top"
                                          DocType="{Binding VALBTYP,ElementName=TV}" 
                                          PrintType="OpenExcel" />
                <WrapPanel>
                    <CheckBox Content="Print Mode" Foreground="Red" IsChecked="{Binding IsPrint,ElementName=TV}"/>
                    <TextBlock Margin="20,0,0,0" Text="If you check the IsPrint, the list will be clear."/>
                </WrapPanel>
                <Button  Margin="20,0,0,0" Grid.Column="1"  Click="PrintCommand" Height="20"
                                      VerticalAlignment="Top"
                                     Width="Auto" Content="{Binding Source={Localization:Translate Word=Print}}" />
                <Button  Margin="20,0,0,0" Grid.Column="1"  Click="PrintExCommand" Height="20"
                                      VerticalAlignment="Top"
                                      Width="Auto" Content="{Binding Source={Localization:Translate Word=EXPrint}}" />
                <TextBlock  Margin="20,0,0,0" Text="{Binding Source={Localization:Translate Word=BarCode:}}"/>
                <ex:TXT72  Margin="20,0,0,0" KeyUp="BarCode_KeyUp" Width="150" 
                           ToolTip="{Binding Source={Localization:Translate Word=scan exisiting barcode and add to print list automatically}}"/>

            </WrapPanel>
            <WrapPanel Margin="20,0,0,0">
                <Button  Margin="20,0,0,0" Grid.Column="1"  Click="BatchDeleteCommand" Height="20" Name="cDelB"
                                      VerticalAlignment="Top"
                                     Width="Auto" Content="BatchDelete" />
                <CheckBox Content="Delete Mode" Foreground="Red" IsChecked="{Binding IsEnabled,ElementName=cDelB}"/>
                <TextBlock Margin="20,0,0,0" Text="If you check this, the delete will be enabled."/>
            </WrapPanel>
        </StackPanel>

        <DataGrid  
                       Grid.Row="1"
                       VerticalAlignment="Top"  
                       AutoGenerateColumns="False"
                       EnableRowVirtualization="False"
                       IsReadOnly="True"
                       VerticalScrollBarVisibility="Auto"
                       HorizontalScrollBarVisibility="Auto"
                       HeadersVisibility="Column"     
                       ItemsSource="{Binding Source={StaticResource vwDetail}}" 
                       IsSynchronizedWithCurrentItem="True" 
                       x:Name="dlgDetail">
            <DataGrid.Columns>
                <DataGridCheckBoxColumn Width="40" Binding="{Binding Path=IsSelected,RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type DataGridRow}}}">
                    <DataGridCheckBoxColumn.HeaderTemplate>
                        <DataTemplate>
                            <CheckBox x:Name="ckbSelectedAll" Checked="ckbSelectedAll_Click" Unchecked="ckbSelectedAll_Unchecked"></CheckBox>
                        </DataTemplate>
                    </DataGridCheckBoxColumn.HeaderTemplate>
                </DataGridCheckBoxColumn>
                <DataGridTextColumn Binding="{Binding Path=VAAART}" Header="Barcode" Width="Auto"  />
                <DataGridTextColumn Binding="{Binding Path=VAABEZ,Converter={StaticResource trim}}" Header="ART NO."  Width="AUTO" />
                <DataGridTextColumn Binding="{Binding Path=VAAFILLER,Converter={StaticResource trim}}" Header="Composition:"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=WEIGHT,Converter={StaticResource trim}}" Header="Weight"  Width="Auto" />
                <DataGridTextColumn Header="Width"  Binding="{Binding Path=WIDTH,Converter={StaticResource trim}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=CODE,Converter={StaticResource trim}}" Header="Code"  Width="AUTO" />
                <DataGridTextColumn Binding="{Binding Path=LSLIEFNA,Converter={StaticResource trim}}" Header="Supplier"  Width="Auto" />
                <DataGridTextColumn Header="Customer Price" Binding="{Binding Path=PRICE,Converter={StaticResource trim}}"   Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=LOCATION}" Header="Location"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=BOOK}" Header="Book"  Width="Auto" />

                <DataGridTextColumn Binding="{Binding Path=REMARK}" Header="{Binding Source={Localization:Translate Word=Remark}}"  Width="Auto" />

                <DataGridTextColumn Binding="{Binding Path=VAAAENDBEN}" Header="{Binding Source={Localization:Translate Word=Modify}}" Visibility="Collapsed" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VAAAENDDAT}" Header="{Binding Source={Localization:Translate Word=Date}}"  Visibility="Collapsed" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VAANEUBEN}" Header="{Binding Source={Localization:Translate Word=Creat}}"  Visibility="Collapsed" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VAANEUDAT}" Header="{Binding Source={Localization:Translate Word=Date}}"  Visibility="Collapsed" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VAASPERRDAT}" Header="{Binding Source={Localization:Translate Word=DelDate}}"    Width="Auto" />
            </DataGrid.Columns>
        </DataGrid  >
    </Grid>
</me:UIVAART> 
 
